// // ******************************************************************
// //       /\ /|       @file       ITranslationRecordRepository.cs
// //       \ V/        @brief      await29
// //       | "")       @author     Await, 285283010@qq.com
// //       /  |
// //      /  \\        @Modified   2025-02-20 20:02
// //    *(__\_\        @Copyright  Copyright (c) , 2025-02-20 20:02 Await
// // ******************************************************************

using AutomaticSubtitles.Service.DataAccess.Model;

namespace AutomaticSubtitles.Service.Domain.Translate;

public interface ITranslationRecordRepository : IRepository<Auto_TranslationRecord>
{
    /// <summary>
    /// 获取翻译记录列表
    /// </summary>
    /// <param name="mediaId">媒体ID</param>
    /// <param name="mediaName">媒体名称</param>
    /// <param name="name">记录名称</param>
    /// <param name="translatedLanguage">目标语言</param>
    /// <param name="startTime">开始时间</param>
    /// <param name="endTime">结束时间</param>
    /// <param name="sortField">排序字段</param>
    /// <param name="sortOrder">排序方向(asc/desc)</param>
    /// <param name="pageSize">每页大小</param>
    /// <param name="pageIndex">页码</param>
    /// <returns>记录列表和总记录数</returns>
    Task<(List<Auto_TranslationRecord> Records, long Total)> GetTranslationRecordsAsync(
        string? mediaId = null,
        string? mediaName = null,
        string? name = null,
        string? translatedLanguage = null,
        DateTime? startTime = null,
        DateTime? endTime = null,
        string? sortField = null,
        string? sortOrder = null,
        int pageSize = 20,
        int pageIndex = 1);

    /// <summary>
    /// 批量删除翻译记录
    /// </summary>
    Task<int> DeleteTranslationRecordsAsync(List<string> ids);

    /// <summary>
    /// 获取要删除的记录列表
    /// </summary>
    Task<List<Auto_TranslationRecord>> GetRecordsByIdsAsync(List<string> ids);

    /// <summary>
    /// 添加翻译记录
    /// </summary>
    /// <param name="record">翻译记录实体</param>
    /// <returns>添加成功后的记录ID</returns>
    Task<string> AddTranslationRecordAsync(Auto_TranslationRecord record);
}